﻿<Window x:Class="HotMess.ConfigurationWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="600"
      x:Name="root" Title="Configuration" KeyDown="Window_KeyDown" KeyUp="Window_KeyUp">
    
    <Window.Resources>
        <DataTemplate x:Key="pinConfigTemplate">
            <StackPanel Orientation="Horizontal" Background="{Binding DebugBackgroundColor}">
                <CheckBox IsChecked="{Binding IsEnabled}" Width="20" VerticalAlignment="Center" />
                <TextBlock Text="ID: "         Foreground="{Binding DebugForegroundColor}"></TextBlock>
                <TextBlock Text="{Binding Id}" Foreground="{Binding DebugForegroundColor}" Width="50"></TextBlock>
                <TextBlock Text="Key: "         Foreground="{Binding DebugForegroundColor}"></TextBlock>
                <TextBlock Text="{Binding KeyName}" Foreground="{Binding DebugForegroundColor}" Width="40"></TextBlock>
                <TextBox Text="{Binding Name}" Foreground="{Binding DebugForegroundColor}" MinWidth="80" />
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
    
    <Grid Height="600">
        <TextBlock Height="23" HorizontalAlignment="Left" Name="textBlock1" Text="Only the checked pins will be used in the game." VerticalAlignment="Top" Width="500" />
        <Button Name="AcceptButton" Content="Accept" Height="51" HorizontalAlignment="Left" Margin="314,505,0,0" VerticalAlignment="Top" Width="74" Click="AcceptButton_Click" />
        <ListBox Height="470" HorizontalAlignment="Left" Margin="12,29,0,0" Name="listBox1" VerticalAlignment="Top" Width="376"
                 ItemTemplate="{StaticResource pinConfigTemplate}" ItemsSource="{Binding GameConfig.Pins, ElementName=root}" />
        <CheckBox Content="Debug Mode" Height="22" HorizontalAlignment="Left" Margin="13,510,0,0" Name="checkBoxDebug" VerticalAlignment="Top" IsChecked="{Binding GameConfig.Debug, ElementName=root}" Width="128" />
        <TextBox Height="21" HorizontalAlignment="Left" Margin="13,538,0,0" Name="textBoxLossRecoveryTime" VerticalAlignment="Top" Width="36" Text="{Binding GameConfig.LossRecoveryTimeString, ElementName=root}" />
        <Label Content="Loss Recovery Time (seconds)" Height="27" HorizontalAlignment="Left" Margin="55,538,0,0" Name="label1" VerticalAlignment="Top" Width="176" />
    </Grid>
</Window>
